/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package FolderChunks;

/**
 *
 * @author DongVan
 */
public class InfoChunk {
    private int m_index;
    private String m_FileName;
    private String m_HashValue;
    public String getM_HashValue() {
        return m_HashValue;
    }

    public void setM_HashValue(String m_HashValue) {
        this.m_HashValue = m_HashValue;
    }

    public int getM_index() {
        return m_index;
    }

    public void setM_index(int m_index) {
        this.m_index = m_index;
    }
    
    public InfoChunk(){
        
    }
    
    public InfoChunk(int index,String fileName, String hashValue){
        this.m_index = index;
        this.m_FileName = fileName;
        this.m_HashValue = hashValue;
    }
    
    public InfoChunk(String chunkInfo) {
        if (chunkInfo.contains(global.separatorBittorentTxt)) {
            String[] arrayChunkInfo = chunkInfo.split(global.separatorBittorentTxt);
            this.m_index = Integer.parseInt(arrayChunkInfo[0]);
            this.m_FileName = arrayChunkInfo[1];
            this.m_HashValue = "";
        }
    }
    
    /**
     * @return the m_FileName
     */
    public String getM_FileName() {
        return m_FileName;
    }

    /**
     * @param m_FileName the m_FileName to set
     */
    public void setM_FileName(String m_FileName) {
        this.m_FileName = m_FileName;
    }
    
    public String getFileNameChunk(){
        return this.m_FileName+String.valueOf(this.m_index)+".chunk";
    }
}
